<template>
	<view>
		<view style="height: 100px;"></view>
		<button @click="pay()">123</button>
	</view>
</template>

<script>
	var Request = getApp().globalData.Request;
	var Api = getApp().globalData.Api;

	export default {
		data() {
			return {
				aa: null
			}
		},
		methods: {
			pay() {
				Request.requestSync({
					url: Api.authPayGoods.createPayingParam,
					data: {
						goodsParentName: "test01", //此类商品统一识别名称，必填
						payParam: [{
							goodsId: 1, //商品id,必填
							number: 1, //数量，选填
							coupons: [], //优惠券,选填
							otherParam: [{ //其它参数

							}]
						}]
					},
					success: (res) => {
						uni.requestPayment({
							provider: 'wxpay', // 服务提提供商
							...res.data.data, // 签名
							success: function(res1) {
								console.log('支付成功', res1);
								// 业务逻辑。。。
							},
							fail: function(err1) {
								console.log('支付失败', err1);
							}
						});

					}
				});
			}
		}
	}
</script>

<style>

</style>
